<template>
  <div class="dialog">
    <el-dialog
      :title="dialog.title"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      :modal-append-to-body="false"
      :visible.sync="dialog.show"
    >
      <el-form label-width="120px" ref="StuForm" :model="StuForm">
        <el-form-item v-show="false" label="序号：" prop="_id">
          <el-input
               v-model="StuForm._id"
          ></el-input>
        </el-form-item>
        <el-form-item label="电话：" prop="tel">
          <el-input
            v-model="StuForm.tel"
          ></el-input>
        </el-form-item>
        <el-form-item label="姓名：" prop="name">
          <el-input
            v-model="StuForm.name"
          ></el-input>
        </el-form-item>
        <el-form-item label="年龄：" prop="age">
          <el-input
            v-model="StuForm.age"
          ></el-input>
        </el-form-item>
        <el-form-item label="地址：" prop="address">
          <el-input
                  v-model="StuForm.address"
          ></el-input>
        </el-form-item>
        <el-form-item label="性别：" prop="sex">
          <el-input
                  v-model="StuForm.sex"
          ></el-input>
        </el-form-item>
        <el-form-item label="身份：" prop="identity">
          <el-input
               v-model="StuForm.identity"
          ></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="handleClose()">取 消</el-button>
        <el-button type="primary" @click="handleAndEdit()">确定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  name: "Dialog",
  props: {
    dialog: Object,
    StuForm:Object
  },
  methods: {
    handleAndEdit() {
      this.$emit("saveStu", this.StuForm);
      this.dialog.show = false;
    },
    handleClose() {
      this.dialog.show = false;
    },
  },
};
</script>
<style scoped>
</style>